<!DOCTYPE HTML>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="keywords" content="<?= $this->meta_keywords ?>" />
    <meta name="title" content="<?= $this->meta_title ?>" />
    <meta name="description" content="<?= $this->meta_description ?>" />
    <meta name="uri-translation" content="on" />
    <title><?= $this->meta_title ?></title>

    <link rel="shortcut icon" href="<?php echo base_url();?>public/images/favicon.ico" />

    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
    <!--[if lt IE 9]>
    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <script type="text/javascript" src="<?php echo base_url();?>public/js/jquery-1.8.3.min.js"></script>
    <script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>


    <!--<script type='text/javascript' src='<?php /*echo base_url();*/?>public/js/respond.min.js'></script>-->
    <!-- SlideShow -->
    <script type="text/javascript" src="<?php echo base_url();?>public/js/bgstretcher.js"></script>
    <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>public/css/bgstretcher.css" />
    <!-- MainCSS -->
    <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>public/css/main.css" />

    <script type="text/javascript">
        $(document).ready(function(){

            $('body').bgStretcher({
                images: [

                    '<?php echo base_url();?>public/images/background/lyn-hotel-deluxe-room.jpg'
                ],
                imageWidth: 1920,
                imageHeight: 1020,
                slideDirection: 'N',
                slideShowSpeed: 1400,
                transitionEffect: 'fade',
                sequenceMode: 'normal',
                buttonPrev: '#prev',
                buttonNext: '#next',
                pagination: '#nav',
                anchoring: 'center center',
                anchoringImg: 'center center'
            });

        });

    </script>
    
	<!-- gallery -->
    <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>public/css/jquery.thumbox.1.2.css" />
    <!--<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>--> 
    <script type="text/javascript" src="<?php echo base_url();?>public/js/popup/jquery.easing.1.3.js"></script>
    <script type="text/javascript" src="<?php echo base_url();?>public/js/popup/jquery.thumbox.1.2.js"></script>
    <script type="text/javascript">
        $(function(){
            $('.tuto-thumbox ul').thumbox({showOne:true,thumbs:4, dockPosition:'bottom', maxThumbWidth:50, labelPosition:'top'});
        })
    </script>
    <!-- end gallery-->
    
    <?php include('application/views/lyn/v_analyticstracking.php'); ?>

</head>
<body>
    <?php // onLoad="showModal()" ?>

    <div id="container">
        <div id="header">
            <div class="wrapHeader">
                <div class="bg-logo"></div>
                <?= anchor(
                    "",
                    '<div class="logo"></div>',
                    isset($page_name) ? ( $page_name == "contacts" ? "class='active'" : "" ) : "" );?>
            </div>
        </div><!-- .header -->
        <div class="clear"></div>

    <link rel="stylesheet" href="<?php echo base_url();?>public/css/jquery.datepick.css">
    <script src="<?php echo base_url();?>public/js/jquery.datepick.js"></script>
    <script type="text/javascript">

        //$(document).ready(function(){

            var next = $(".next");
            var back = $(".back");
            var booking = $(".btn_booking")

            next.click(function(e) {

                var id = e.target.id;

                $("#room"+id).hide('slide', 500);
                $("#detail"+id).show('slide', { direction: "right" }, 500);
            });

            back.click(function(e) {

                var id = e.target.id;

                $("#detail"+id).hide('slide', { direction: "right" }, 500);
                $("#room"+id).show( "slide", 500 );
            });

            booking.click(function() {
                var id = $(this).attr('rel');

                $("#bodyDetail"+id).hide();
                $("#booking"+id).fadeIn( "slow" );
            });


            var form = $("#bookingForm");
            /*var name = $("#name");
            var name_info = $("#name_info");
            var email = $("#email");
            var email_info = $("#email_info");
            var check_in = $("#check_in");
            var check_out = $("#check_out");
            var check_info = $("#check_info");*/
            var btn_confirm = $(".btn_confirm");

            //validation functions

            function validateName(id){
                var field = $("#name" + id);
                var field_info =  $("#name_info" + id);

                if(field.val() == ""){
                    field.addClass("error");
                    field_info.toggle();
                    field_info.show();
                    return false;
                }
                //if it's valid
                else{
                    field.removeClass("error");
                    field_info.toggle();
                    field_info.hide();
                    return true;
                }
            }

            function validateEmail(id){
                var field = $("#email" + id);
                var field_info =  $("#email_info" + id);

                var a = field.val();
                var filter = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})$/;
                //if it's valid email
                if(filter.test(a)){
                    field.removeClass("error");
                    field_info.toggle();
                    field_info.hide();
                    return true;
                }
                //if it's NOT valid
                else{
                    field.addClass("error");
                    field_info.toggle();
                    field_info.show();

                    return false;
                }
            }

            function validateCheckIn(id){
                var field = $("#check_in" + id);
                var field_info =  $("#check_info" + id);

                if(field.val() == ""){
                    field.addClass("error");
                    field_info.toggle();
                    field_info.show();
                    return false;
                }
                //if it's valid
                else{
                    field.removeClass("error");
                    field_info.toggle();
                    field_info.hide();
                    return true;
                }
            }

            function validateCheckOut(id){
                var field = $("#check_out" + id);
                var field_info =  $("#check_info" + id);

                if(field.val() == ""){
                    field.addClass("error");
                    field_info.toggle();
                    field_info.show();
                    return false;
                }
                //if it's valid
                else{
                    field.removeClass("error");
                    field_info.toggle();
                    field_info.hide();
                    return true;
                }
            }

            /*checking validation submit form booking*/
            btn_confirm.click(function(){

                var id = $(this).attr('rel');

                if( validateName(id) & validateEmail(id) & validateCheckIn(id) & validateCheckOut(id) )
                {
                    $('#form_value').val(id);
                    submit_booking(id);
                }
                else
                    return false;
            });
        //});

        function submit_booking(id)
        {
            var pickUp;

            if($("#pick_up" + id).is(':checked'))
                pickUp = 'Yes';
            else
                pickUp = "No";

            $.ajax({
                url: "<?= base_url();?>booking.html",
                data: {
                    form_value: $("#form_value").val(),
                    room_name: $("#room_name" + id).val(),
                    name: $("#name" + id).val(),
                    email: $("#email" + id).val(),
                    nationality: $("#nationality" + id).val(),
                    check_in: $("#check_in" + id).val(),
                    check_out: $("#check_out" + id).val(),
                    guest: $("#guest" + id).val(),
                    pick_up: pickUp

                },
                type: "post",
                success: function(message)
                {
                    $('#booking'+id).html(message);

                        window.setTimeout(function(){location.reload()},4000)

                } //end success
            });
        }

    </script>

    <!-- ** Body ** -->
    <div id="body">
        <div class="wrapBody">
            <?php //$this->load->view('sejour/v_menu');?>

            <div class="bodyContent ml180">

                <div class="mainTitle">
                    <h1>CONTEMPORARY <span class="hightlight">URBAN</span> RESORT &nbsp;</h1>
                </div>
                <div class="bar"></div>

                <div class="content room">

                    <?php echo form_open('c_room/booking', 'id="bookingForm" name="bookingForm"'); ?>

                    <?php if( sizeof($results)>0 )
                    {
                        foreach( $results as $value )
                        {
                    ?>
                        <div class="contentBox">

                                <div class="mainPage mainText" id="room<?= $value['id'] ?>">
                                    <div class="tuto-thumbox">
                                        <ul>
                                            <?php /*?><li><a href="<?= base_url();?>upload/room/thumb/thumb_<?= $value['image'] ?>"><img src="<?= base_url();?>upload/room/thumb/thumb_<?= $value['image'] ?>" alt="<?= $value['name'] ?>" align="left"></a></li><?php */?>
                                            
                                            <?php
											if($value['id'] == 1){
                                            ?>
                                            <li>
                                            	<a href="<?= base_url();?>public/images/gallery/suites/1.jpg">
	                                            	<img src="<?= base_url();?>upload/room/thumb/thumb_<?= $value['image'] ?>" alt="LYN <?= $value['name'] ?> " align="left">
                                                	<div class="more-gallery">
                                                        <img src="<?= base_url();?>public/images/more-gallery.png" alt="More gallery" width="20px" height="20px">
                                                    </div>
                                                    <span class="more-text">more images</span>
                                                </a>
                                            </li>
                                            
                                            <li><a href="<?= base_url();?>public/images/gallery/suites/2.jpg" ><img src="<?= base_url();?>public/images/gallery/suites/2.jpg" width="150" height="150"  align="left" alt="LYN <?= $value['name'] ?>" ></a></li>
                                            <li><a href="<?= base_url();?>public/images/gallery/suites/3.jpg" ><img src="<?= base_url();?>public/images/gallery/suites/3.jpg" width="150" height="150"  align="left" alt="LYN <?= $value['name'] ?>" ></a></li>
                                            
                                            <?php
											}elseif($value['id'] == 2){
                                            ?>
                                            <li><img src="<?= base_url();?>upload/room/thumb/thumb_<?= $value['image'] ?>" alt="<?= $value['name'] ?>" align="left"></li>
                                            <?php
											}elseif($value['id'] == 3){
                                            ?>
                                            <li>
                                            	<a href="<?= base_url();?>public/images/gallery/deluxe-bangalow/deluxebunagalo.jpg">
                                            		<img src="<?= base_url();?>upload/room/thumb/thumb_<?= $value['image'] ?>" alt="<?= $value['name'] ?>" align="left">
                                                     <div class="more-gallery">
                                                        <img src="<?= base_url();?>public/images/more-gallery.png" alt="More gallery" width="20px" height="20px">
                                                    </div>
                                                    <span class="more-text">more images</span>
                                                </a>
                                            </li>
                                            
                                            
                                            <li><a href="<?= base_url();?>public/images/gallery/deluxe-bangalow/deluxe-by-night.jpg" ><img src="<?= base_url();?>public/images/gallery/deluxe-bangalow/deluxe-by-night.jpg" width="150" height="150"  align="left" alt="Deluxe By Night" ></a></li>
                                            <li><a href="<?= base_url();?>public/images/gallery/deluxe-bangalow/river-bungalow-angkor.jpg" ><img src="<?= base_url();?>public/images/gallery/deluxe-bangalow/river-bungalow-angkor.jpg" width="150" height="150"  align="left" alt="River Bungalow Angkor" ></a></li>
                                            <li><a href="<?= base_url();?>public/images/gallery/deluxe-bangalow/room-amenities.jpg" ><img src="<?= base_url();?>public/images/gallery/deluxe-bangalow/room-amenities.jpg" width="150" height="150"  align="left" alt="Room Amenities" ></a></li>
                                            <li><a href="<?= base_url();?>public/images/gallery/deluxe-bangalow/special-service-luxury.jpg" ><img src="<?= base_url();?>public/images/gallery/deluxe-bangalow/special-service-luxury.jpg" width="150" height="150"  align="left" alt="Special Service Luxury" ></a></li>
                                            <li><a href="<?= base_url();?>public/images/gallery/deluxe-bangalow/urban-hotel-1.jpg" ><img src="<?= base_url();?>public/images/gallery/deluxe-bangalow/urban-hotel-1.jpg" width="150" height="150"  align="left" alt="Urban Hotel" ></a></li>
                                            <?php
											}elseif($value['id'] == 4){
                                            ?>
                                            <li><img src="<?= base_url();?>upload/room/thumb/thumb_<?= $value['image'] ?>" alt="<?= $value['name'] ?>" align="left"></li>
                                            <?php
											}
                                            ?>
                                        </ul>
                                        <h2>&nbsp;</h2>
                                    </div><!-- end tuto-thumbox-->

                                    <div class="pr30">
                                        <h2>LYN<span class="cDefault"><?= $value['name']?></span></h2>
                                        <p></p>
                                        <?= $value['description']?>
                                    </div>
                                    <?php
									if($value['id'] == 3){
                                    ?>
                                   <!-- <div class="more-gallery">
                                        <img src="<?= base_url();?>public/images/more-gallery.png" alt="More gallery" width="20px" height="20px">
                                    </div>
                                    <span class="more-text">more images</span>-->
                                    <?php
									}
                                    ?>
                                    <div class="next" id="<?= $value['id'] ?>"></div>
                                </div>
                                <!-- P.Detail -->
                                <div class="mainDetail" id="detail<?= $value['id'] ?>">
                                    <div class="bodyDetail" id="bodyDetail<?= $value['id'] ?>">
                                        <div class="detailLeft">
                                            <h2>LYN<span class="cDefault"><?= $value['name']?></span></h2>
                                            <div class="relative">
                                                    <div class="box-equip">
                                                        <div class="equip-image"><img src="<?= base_url();?>public/images/room/icon-minibar.png" align="center" /></div>
                                                        <p class="equip-title mt7">mini-bar</p>
                                                    </div>
                                                    <div class="box-equip">
                                                        <div class="equip-image"><img src="<?= base_url();?>public/images/room/icon-wifi.png" align="center" /></div>
                                                        <p class="equip-title mt7">Wifi Internet</p>
                                                    </div>
                                                    <div class="box-equip">
                                                        <div class="equip-image"><img src="<?= base_url();?>public/images/room/icon-telephone.png" align="center" /></div>
                                                        <p class="equip-title">International Dailing Telephone</p>
                                                    </div>

                                                    <div class="box-equip">
                                                        <div class="equip-image"><img src="<?= base_url();?>public/images/room/icon-tea-coffee.png" align="center" /></div>
                                                        <p class="equip-title">Electric kettle Coffee & tea</p>
                                                    </div>
                                                    <div class="box-equip">
                                                        <div class="equip-image"><img src="<?= base_url();?>public/images/room/icon-wine.png" align="center" /></div>
                                                        <p class="equip-title mt7">Drinking water</p>
                                                    </div>
                                                    <div class="box-equip">
                                                        <div class="equip-image"><img src="<?= base_url();?>public/images/room/icon-air.png" align="center" /></div>
                                                        <p class="equip-title mt7">Air Conditioning</p>
                                                    </div>

                                                    <div class="box-equip">
                                                        <div class="equip-image"><img src="<?= base_url();?>public/images/room/icon-safebox.png" align="center" /></div>
                                                        <p class="equip-title mt7">Safety Box</p>
                                                    </div>
                                                    <div class="box-equip">
                                                        <div class="equip-image"><img src="<?= base_url();?>public/images/room/icon-lcd.png" align="center" /></div>
                                                        <p class="equip-title mt7">LCD TV Cable</p>
                                                    </div>

                                                    <div class="box-equip nbg pl20 pt10 fright">
                                                        <h2>Starting From</span></h2>
                                                        <span class="price">USD <?= $value['rate'] ?>/night</span>
                                                    </div>

                                                <div class="clear"></div>
                                            </div>
                                        </div>

                                        <div class="detailRight">
                                            <div class="bookingBox">
                                                <div class="btn_booking btn_booking_click" rel="<?= $value['id'] ?>">
                                                    <span>BOOK NOW</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="clear"></div>
                                        <div class="back" id="<?= $value['id'] ?>"></div>
                                    </div>

                                    <div class="booking" id="booking<?= $value['id'] ?>">
                                        <h2>LYN<span class="cDefault"><?= $value['name']?></span></h2>

                                        <div class="detailLeft">

                                            <div>
                                                <p>
                                                    <?= form_label('YOUR NAME'); ?>
                                                    <span class="hightlight">*</span>
                                                    <span class="hightlight name_info" id="name_info<?=$value["id"]?>">[PLEASE ENTER THIS FIELD]</span><br />
                                                    <?= form_input('name'.$value["id"],'', 'id="name'.$value["id"].'" class="input-text mr10" autofocus'); ?>
                                                </p>

                                                <p>
                                                    <?= form_label('EMAIL ADDRESS'); ?>
                                                    <span class="hightlight">*</span>
                                                    <span class="hightlight email_info" id="email_info<?=$value["id"]?>">[PLEASE ENTER THIS FIELD]</span><br />
                                                    <?= form_input('email'.$value["id"],'', 'id="email'.$value["id"].'" class="input-text" autofocus'); ?>
                                                </p>

                                                <p>
                                                    <?= form_label('NATIONALITY'); ?><br />
                                                    <?= form_input('nationality'.$value["id"],'', 'id="nationality'.$value["id"].'" class="input-text" autofocus'); ?>
                                                </p>

                                            </div>
                                        </div>

                                        <div class="detailCenter">
                                            <script type="text/javascript">
                                                $(document).ready(function(){
                                                    /*on date arrival*/
                                                    $('#check_in<?=$value["id"]?>').datepick({
                                                        minDate: 0
                                                    });
                                                    /*on date arrival*/
                                                    $('#check_out<?=$value["id"]?>').datepick({
                                                        minDate: 0
                                                    });
                                                });
                                            </script>

                                            <p>
                                                <?= form_label('CHECK-IN DATE'); ?> <span class="hightlight">*</span><br />
                                                <?= form_input('check_in'.$value["id"],'', 'id="check_in'.$value["id"].'" class="input-text" readonly="readonly"'); ?>
                                            </p>
                                            <p>
                                                <?= form_label('CHECK-OUT DATE'); ?> <span class="hightlight">*</span><br />
                                                <?= form_input('check_out'.$value["id"],'', 'id="check_out'.$value["id"].'" class="input-text" readonly="readonly"'); ?>
                                            </p>
                                            <span class="hightlight check_info"  id="check_info<?=$value["id"]?>">[PLEASE ENTER THIS FIELD]</span><br />
                                        </div>

                                        <div class="detailRight">
                                            <p>
                                                <?= form_label('NUMBER OF GUEST(S)'); ?> <span class="hightlight">*</span>
                                            </p>

                                            <p class="line1">
                                                <?= form_radio('guest'.$value["id"], '1', TRUE, 'id="guest'.$value["id"].'"') ?>
                                                <img src="<?= base_url();?>public/images/icon-man.png" />
                                            </p>

                                            <p class="line2">
                                                <?= form_radio('guest'.$value["id"], '2', FALSE, 'id="guest'.$value["id"].'"') ?>
                                                <img src="<?= base_url();?>public/images/icon-man.png" />
                                                <img src="<?= base_url();?>public/images/icon-man.png" />
                                            </p>

                                        </div>
                                        <div class="clear"></div>

                                        <div class="detailBottom">
                                            <div class="pickUp">
                                                <?= form_checkbox('pick_up'.$value["id"],'1', false, 'id="pick_up'.$value["id"].'"'); ?>
                                                <span>Please organise an aiport / port  or  bus-station pick up</span>
                                            </div>

                                            <input type="hidden" name="room_name<?= $value["id"]?>" id="room_name<?= $value["id"]?>" value="<?= $value["name"]?>">
                                            <? //= form_submit('btn_confirm', 'CONFIRM'.$value["id"], 'rel="b'.$value["id"].'" class="fright btn_confirm"'); ?>

                                            <?= form_button('btn_confirm', 'CONFIRM', 'rel="'.$value["id"].'" class="fright btn_confirm"'); ?>

                                        </div>


                                        <div class="clear"></div>

                                    </div>

                                </div>

                        </div>

                        <div class="bar"></div>
                        <div class="bar2"></div>

                    <?php
                        }//end foreach
                    } //end if
                    ?>
                        <input type="hidden" name="form_value" id="form_value">
                    <?= form_close() ?>

                    <?php //$this->load->view('lyn/v_menu');?>
                
                </div><!-- .content -->
            </div><!-- .bodyContent -->


        </div><!-- .wrapHeader -->


<?php $this->load->view('lyn/v_footer');?>